<?php

namespace app\admin\controller;

use app\logic\Login as LogicLogin;

class Login extends Common
{
    public function _initialize()
    {
        parent::_initialize();
    }

    /**
     * 管理员密码登录 \n
     * URI : /admin/login.pwd
     * @param :
     *  name         | type   | null | description
     * --------------|--------|------|-------------
     *  loginAccount | string | 必填 | 登录账号
     *  loginPassword| string | 必填 | 登录密码
     *
     * @return
     *  name    | type | description
     * ---------|------|-------------
     *  passport| int  | 用户票据
     *
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function pwdLogin()
    {
        $str_login_account = $this->_getContentParams('loginAccount');
        $str_login_password = $this->_getContentParams('loginPassword');
        $obj = new LogicLogin('admin');
        $obj->accountPasswordLogin($str_login_account, $str_login_password, $this->_getParams('platform'));
    }
}
